#!/usr/bin/env bash

A='ps -c nginx --no-header | wc -l'

if [ "$A" -eq 0 ]; then
  /usr/local/nginx/sbin/nginx
  sleep 3
  if [ "$(ps -c nginx --no-header wc -l)" -eq 0 ]; then
    killall keepalived
  fi
fi
